public class Main {
    public static void main(String[] args) {
        int i=21,n=1,j=21,sum=0;
        while(j<1000){
            sum+=j;
            n++;
            j=n*i;
        }
        System.out.println("sum="+sum);
    }
}